package com.szxy.hotel.service;

import com.szxy.hotel.entity.Vip;
import com.szxy.hotel.entity.Viprecode;
import com.szxy.hotel.mapper.VipMapper;
import com.szxy.hotel.mapper.ViprecodeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("vipService")
public class VipService {
    @Resource
    VipMapper vipMapper;
    @Resource
    ViprecodeMapper viprecodeMapper;

    public void insertVip(String userName,Double money,String vipType,String vipDiscount,Double vipDisDouble) {
        vipMapper.insertVip(userName,money,vipType,vipDiscount,vipDisDouble);
    }

    public void insertViprecode(int id, String vipType, Double money) {
        viprecodeMapper.insertViprecode(id,vipType,money);
    }

    public Viprecode selectViprecode(int id) {
        return viprecodeMapper.selectViprecode(id);
    }

    public void updateViprecode(int id, String vipType, Double money) {
        viprecodeMapper.updateViprecode(id,vipType,money);
    }

    public void updateVip(String userName, Double money, String vipType, String vipDiscount,Double vipDisDouble) {
        vipMapper.updateVip(userName,money,vipType,vipDiscount,vipDisDouble);
    }

    public void updateVipMoney(String userName, Double money) {
        vipMapper.updateVipMoney(userName,money);
    }

    public List<Vip> findByPage(int start, int size) {
        return vipMapper.findByPage(start,size);
    }

    public List<Vip> selectCount() {
        return vipMapper.selectCount();
    }

    public Vip selectByName(String roomName) {
        return vipMapper.selectByName(roomName);
    }
}
